package com.qyhl.webtv.module_circle.utils.itemview;

import com.qyhl.webtv.commonlib.entity.circle.CircleHomeBean;
import com.zhy.adapter.abslistview.CommonAdapter;

import java.util.List;

/**
 * Created by qyhl on 2018/1/19.
 */

public class ItemViewPresenter implements ItemViewContract.ItemPresenter {
    private ItemViewContract.ItemView mView;
    private ItemViewModel mModel;

    public ItemViewPresenter(ItemViewContract.ItemView mView) {
        this.mView = mView;
        this.mModel = new ItemViewModel(this);
    }


    @Override
    public void doLove(String topicId, CircleHomeBean bean) {
        mModel.doLove(topicId, bean);
    }

    @Override
    public void undoLove(String topicId, CircleHomeBean bean) {
        mModel.undoLove(topicId, bean);
    }


    @Override
    public void doLoveSuccess( CircleHomeBean bean) {
        mView.doLoveSuccess(bean);
    }

//    @Override
//    public void doLoveError(String msg,TextView likeBtn) {
//        mView.doLoveError(msg,likeBtn);
//    }

    @Override
    public void undoLoveSuccess( CircleHomeBean bean) {
        mView.undoLoveSuccess(bean);
    }

//    @Override
//    public void undoLoveError(String msg,TextView likeBtn) {
//        mView.undoLoveError(msg,likeBtn);
//    }

    @Override
    public void deleteComment(String postId, List<CircleHomeBean.PostList> beanList, CommonAdapter commonAdapter) {
        mModel.deleteComment(postId,beanList,commonAdapter);
    }

    @Override
    public void deleteSuccess(List<CircleHomeBean.PostList> beanList, CommonAdapter commonAdapter) {
         mView.deleteSuccess(beanList,commonAdapter);
    }

    @Override
    public void deleteError(String msg) {
         mView.deleteError(msg);
    }


}
